#include <iostream>

class Message  //信息
{
public:
    void play()
    {
        std::cout<<"发短信\n";
    }
};

class phone
{
public:
    void play()
    {
        std::cout<<"打电话"<<std::endl;
    }

    void sendMessage()
    {
        m.play();
    }
private:
    Message m;  //将一个类的对象塞入另一个类中
};

class Game
{
public:
    void play()
    {
        std::cout<<"玩游戏"<<std::endl;
    }
};

class SmartPhone:public phone,public Game   //多继承:一个子类有多个父类
{

};

//多重继承:子类的父类仍有父类：间接基类
int main()
{
    SmartPhone s;
    s.sendMessage();  //二义性问题
    return 0;
}